﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Help;
using Model;
using Bll;

namespace Myproject.BSM.Ashx.PcBase
{
    /// <summary>
    /// NavigationRank2 的摘要说明
    /// </summary>
    public class NavigationRank2 : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string id = context.Request.QueryString["id"];
            string rank = context.Request.QueryString["rank"];
            if (id != "0")
            {
                NavModel model = new NavBLL().GetModel(int.Parse(id));
                model.SonRank += int.Parse(rank);
                if (new NavBLL().Update(model))
                {
                    context.Response.Write(ReturnJsonHelp.OutHandlerJson(true, "修改排序成功！"));
                }
                else
                {
                    context.Response.Write(ReturnJsonHelp.OutHandlerJson(false, "修改排序失败！"));
                }
            }
            else
            {
                context.Response.Write(ReturnJsonHelp.OutHandlerJson(false, "修改排序失败！"));
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}